-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(commerce): allow for locale-specific product name patterns #3657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(commerce): allow for locale-specific product name patterns #3657
Conversation
✅ Deploy Preview for fakerjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Introduces localized product-name patterns across the commerce locales.
Added a patterns array to each src/locales/*/commerce/product_name.ts
For en locale, for example it’s “{{commerce.productAdjective}} {{commerce.productMaterial}} {{commerce.product}}” preserving the traditional “Tasty Granite Socks”
This allows for languages where the adjectives typically follow the noun e.g. fr, or rtl languages like he, or languages without spaces like zh_CN.
I am not an expert in all languages so there might be minor mistakes in some locales but it should be better than current version.
Some generations:
```
ar أحذية مجمد رائع
az Ergonomik Rezin Stol
da Ubranded Plastik Sæbe
el Απίστευτο Φρέσκο Τραπέζι
en Practical Plastic Pants
eo populara trikita nomŝildo
es Salchichas Pequeño de Metal
es_MX Tuna Rústico de Soft
fa سالاد تازه خوش طعم
fr Chemise Raffiné en Béton
he עוף כפרי מפלדה
hu Márka nélküli Műanyag Cipő
id_ID Celana Kayu Ramping
lv Mazs plastmasas plāksteris
nl elektrische katoenen zak
pt_BR Teclado Genérico de Concreto
pt_PT Pizza Licenciado de Fresco
ru Интеллектуальный Меховой Компьютер
sv Liten Stål Bil
tr Küçük İpek Kayseri Pastırması
ur خوبصورت کنکریٹ پتلون
uz_UZ_latin Arzon Muzlatilgan Paypoq
zh_CN 钢电子的肥皂
```
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #3657 +/- ##
=======================================
Coverage 99.97% 99.97%
=======================================
Files 2995 2995
Lines 236243 236313 +70
Branches 941 939 -2
=======================================
+ Hits 236186 236256 +70
Misses 57 57
🚀 New features to boost your workflow:
|
Shinigami92
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go from my side ✅
Introduces localized product-name patterns across the commerce locales for
faker.commerce.productName().Added a patterns array to each
src/locales/*/commerce/product_name.tsFor en locale, for example it’s
“{{commerce.productAdjective}} {{commerce.productMaterial}} {{commerce.product}}”preserving the traditional “Tasty Granite Socks”This allows for languages where the adjectives typically follow the noun e.g.
fr, or rtl languages likehe, or languages without spaces likezh_CN.I am not an expert in all languages so there might be minor mistakes in some locales but it should be better than current version. I only added one pattern per language though this gives the flexibility to add more in future if needed.
Some generations: